<?php
namespace app\admin\controller\menu;
use think\Request;
use app\admin\server\menu\Menu as MenuServer;
use think\config;
use app\admin\common;
use think\facade\Session;
use think\facade\View;
use app\admin\ControllerBase;
use app\admin\server\system\Job;
/**
 * @title 菜单类
 * 
 */
class Menu extends ControllerBase{
	
	public function __construct(Request $request)
    {
    	$this->REQUEST = $request;
    	self::$s_server=new MenuServer($request);
        
    }
    /**
     * @title 查找所有菜单(角色Id为1用到)
     * @return array 具体内容如下
	 * @return string code - [0成功][201失败][返回的是树形数组]
	 * @return array child - 不为空数组时代表有下级
	 * @return string id - 菜单Id
	 * @return string menu_name - 菜单名称
	 * @return string title - 
	 * @return string checked - [false:当前岗位没有拥有这个菜单][true：当前岗位拥有这个菜单]
     * 
     */
	public function select(){
		$this->requestLog(__function__, $this->REQUEST->param(), '查询系统菜单');
		return $this->commonFunction(__function__);
	}
	
	/**
	 * @title 查询岗位的菜单
	 * @is_header 1
	 * @param string id 岗位id
	 * @return string code - [0成功][201失败][返回的是树形数组]
	 * @return array child - 不为空数组时代表有下级
	 * @return string id - 菜单Id
	 * @return string menu_name - 菜单名称
	 * @return string title - 
	 * @return string checked - [false:当前岗位没有拥有这个菜单][true：当前岗位拥有这个菜单]
	 */
	public function selectRoleMenu(){
		$this->requestLog(__function__, $this->REQUEST->param(), '查询岗位菜单列表');
		return $this->commonFunction(__function__);
	}
	
	/**
	 * @title 给岗位分配菜单
	 * @is_header 1
	 * @param int id 5 岗位的id
	 * @param array perm[0] 10  菜单Id
	 * @param array perm[1] 10  菜单Id
	 * @return string code - [0成功][201失败]
	 */
	 public function assignRolesMenu(){
	 	$this->requestLog(__function__, $this->REQUEST->param(), '分配岗位菜单');
	 	return $this->commonFunction(__function__);
	 }

	

	 
}
?>